import Enums from '../../doc/enums';
import RelType from '../../xlsx/rel-type';

class HyperlinkReader {
    constructor({ workbook, id, iterator, options }) {

        this.workbook = workbook;
        this.id = id;
        this.iterator = iterator;
        this.options = options;
    }

    get count() {
        return (this.hyperlinks && this.hyperlinks.length) || 0;
    }

    each(fn) {
        return this.hyperlinks.forEach(fn);
    }

    async read() {
        const { iterator, options } = this;
        let emitHyperlinks = false;
        let hyperlinks = null;
        switch (options.hyperlinks) {
            case 'emit':
                emitHyperlinks = true;
                break;
            case 'cache':
                this.hyperlinks = hyperlinks = {};
                break;
            default:
                break;
        }

        if (!emitHyperlinks && !hyperlinks) {
            return;
        }
    }
}

export default HyperlinkReader;
